﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Whatzup.Mobi.Web.StreamingMediaServiceRef;

namespace Whatzup.Mobi.Web.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to Whatzup.Mobi.Web !";
            
            SetStreamInfo();

            return View();
        }

        public ActionResult About()
        {
            return View();
        }

        private void SetStreamInfo()
        {
            using (StreamingMediaClient client = new StreamingMediaClient())
            {
                client.Open();

                ViewData["Mobile"] = client.GetMobileUrl();
                ViewData["Pc"] = client.GetPcUrl();

                client.Close();
            }
        }
    }
}
